package org.sith.gl.taskmanager.server.db.service;

import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;


public interface DefaultDAOService<T> {

    @Transactional(propagation = Propagation.REQUIRED)
    public T saveOrUpdate(T t);

    @Transactional(propagation = Propagation.REQUIRED, readOnly = true)
    public T findById(Long id);

    @Transactional(propagation = Propagation.REQUIRED, readOnly = true)
    public List<T> findAll();

    @Transactional(propagation = Propagation.REQUIRED)
    public void remove(T t);

}
